<% String domain = request.getServerName();
	int index = domain.indexOf(".");
	String appId = domain.substring(0, index);
	String projectId = request.getParameter("id");
	
	if (projectId == null) {
	  throw new IllegalArgumentException("Missing required param: id");
	}
	// TODO: Don't hard code all this, retrieve from datastore
	String robotAddress = appId + "+" + projectId + "@" + domain.substring(index + 1, domain.length());
  	String profileImageUrl = "http://" + domain + "/images/forumbotty_thumb.png";
  	String savedSearch = "group:google-wave-api-forum-botty@googlegroups.com tag:" + projectId;
	String projectName = "Wave API Forum Botty";
	String projectDescription = "Makes it easy to creates waves discussing the Google Wave APIs.";
	String triggerText = "New Wave API Post";%>
<extension 
    name="<%=projectName%>"
    thumbnailUrl="<%=profileImageUrl%>"
    description="<%=projectDescription%>"
    version="2"> 
  <author name="Google"/> 
  <savedSearchHook name="Wave API Forum" query="<%=savedSearch%>" color="#337FE5"/>
  <menuHook location="NEW_WAVE_MENU" text="<%=triggerText%>"> 
    <createNewWave> 
      <participant id="<%=robotAddress%>"/>
    </createNewWave> 
  </menuHook>
  <menuHook location="TOOLBAR" text="<%=triggerText%>"
      iconUrl="<%=profileImageUrl%>">    
    <addParticipants> 
      <participant id="<%=robotAddress%>" />
    </addParticipants>    
  </menuHook>    
</extension>